StringScanner.SkipOverString Function

Syntax

Chars_Skipped as N = SkipOverString as n(characters as c)

Arguments

Chars_Skipped

The number of characters the offset has been moved.

characters

The text to find in the buffer.

Description

Skip over matching text. Returns number of characters skipped.

Discussion

The <StringScanner>.SkipOverString() function moves the offset to the end of the specified Text and returns the number of characters that the offset has moved. The offset must be positioned at the beginning of the specified Text for the function to work.

Example

dim scanner as P
dim txt as C
txt = <<%text%
This is wonderful prose written
by a technical writer of note.
%text%
scanner = stringscanner.create(txt)
? scanner.SkipToString("writer")
= .T.
? scanner.SkipOverString("writer")
= 6
? scanner.GetToOffset()
= This is wonderful prose written
by a technical writer
? scanner.getremainder()
= of note.

See Also